<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <style>
        .ta{
            height: 200px;
            float: left;
            margin:0px 100px 30px 100px;
        }
        body{
            background-color: #F3EFE0;
        }
        .bot{
            color: #918E84;
            font-family:Arial, Helvetica, sans-serif;
            font-size: 24px;
            position: relative;
            right: 200px;
            float: right;
        }
        input{
            position: absolute;
            bottom: 20px;
            left: 100px;
        }
    </style>
</head>
<body>
    <script>
     var year=parseInt(prompt('输入年份：','2018'));
     document.write(calendar(year));
     function calendar(y){
         var w=new Date(y,0).getDay();
         var html='';
         for(var m=1;m<=12;++m){
			html += '<table class = "ta">';
			html += '<tr><th colspan="7">&nbsp;'+y+'&nbsp;年&nbsp;'+m+'&nbsp;月</th></tr>';
			html += '<tr><td>日</td><td>一</td><td>二</td><td>三</td><td>四</td>';
			html += '<td>五</td><td>六</td></tr>';
            var max=new Date(y,m,0).getDate();
		    html+='<tr>';
			for(var d=1;d<=max;++d){
                if(w && d==1){
                    html+='<td colspan="'+w+'"></td>';
                }
                html+='<td>'+d+'</td>';
                if(w==6&&d!=max){
                    html+='</tr><tr>';
                }else if(d==max){
                    html+='</tr>';
                }
                w=(w+1>6)?0:w+1;
            }
            html += '</table>';
        }
            return html;
    }
    
    </script>
    <input type="button" value="返回" onclick="location.href = '../章节目录/第五章.html'">
    <div class="bot">
        <h3>Please appreciate((●'◡'●))......</h3>
    </div>

</body>
</html>